package com.example.routelink.gateway.filter;

import cn.hutool.core.util.URLUtil;
import cn.hutool.json.JSONUtil;
import com.example.routelink.gateway.utils.IpUtils;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.gateway.filter.GatewayFilter;
import org.springframework.core.Ordered;
import org.springframework.http.server.reactive.ServerHttpRequest;
import org.springframework.stereotype.Component;
import org.springframework.web.server.ServerWebExchange;

@Component
@Slf4j
public class DesensitizationGatewayFilterFactory extends BaseFilter<DesensitizationGatewayFilterFactory.Config> implements Ordered {
    public DesensitizationGatewayFilterFactory() {
        super(DesensitizationGatewayFilterFactory.Config.class);
    }

    private final String filterName = "数据脱敏";

    @Override
    public GatewayFilter apply(DesensitizationGatewayFilterFactory.Config config) {
        return (exchange, chain) -> {
            return chain.filter(exchange);
        };
    }


    @Override
    public int getOrder() {
        return Ordered.HIGHEST_PRECEDENCE;
    }

    @Data
    public static class Config {

    }
}
